#!/bin/bash
set -e
cd "$(dirname "${BASH_SOURCE[0]}")/../.."

export GOBIN="$PWD/vendor/.bin"
export PATH=$GOBIN:$PATH

go install github.com/sourcegraph/sourcegraph/vendor/honnef.co/go/tools/cmd/megacheck

echo go install...
go install -buildmode=archive ./...

echo go vet...
go vet ./...

echo staticcheck and unused...
megacheck --simple.exit-non-zero=true ./...
